﻿#pragma once
#include "widgets/PropertyProvider.h"

#include "pcl/PclInclude.h"

#include "./PclSurfacesModel.h"

/// <summary>
/// PclSurfacesProvider
/// </summary>
class PclSurfacesProvider : public PropertyProvider
{
    Q_OBJECT

public:
    PclSurfacesProvider();

public:
    void initEditor(QtTreePropertyBrowser* editor);
    void valueChanged(QtProperty*, double) override;
    void valueChanged(QtProperty*, QString) override;
    void valueChanged(QtProperty*, int) override;
    void valueChanged(QtProperty*, bool) override;
    void valueChanged(QtProperty*, const QColor&) override;
    void close() override;
    void doAction();
    /**
     * @brief 无序点云的快速三角测量
     * Fast triangulation of unordered point clouds
     * @ref
     * https://pcl.readthedocs.io/projects/tutorials/en/master/greedy_projection.html
     * @param cloud
     * @param normals
     * @return
     */
    pcl::PolygonMesh::Ptr fastGreedyProjectionTriangulation(
        PointCloudT::Ptr cloud,
        PclSurfacesModel& model
    );

private:
};
